package xyz.bali16.application.security.model;


import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import xyz.bali16.application.entity.Role;


@Data
public class RoleGrantedAuthority implements GrantedAuthority {

    public static final String ROLE_GRANTED_AUTHORITY_PREFIX = "$$$&&&!!!ROLE_";

    private final String authority;

    public RoleGrantedAuthority(Role role) {
        this.authority = ROLE_GRANTED_AUTHORITY_PREFIX + role.getRoleId();
    }

    @Override
    public String getAuthority() {
        return authority;
    }


}
